import { Message } from '../message/index';
import { getErroMessage } from "./code";

const responseConfig = {
    response(response) {
        return response;
    },
    error(response) {
        let error = {};
        error.code = response.statusCode;
        error.message = getErroMessage(error.code);
        Message.error(error.message);
        return {...response, ...error };
    }
};

export default responseConfig;